package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.JtCustomerServiceMapper;
import com.ruoyi.business.domain.JtCustomerService;
import com.ruoyi.business.service.IJtCustomerServiceService;
import com.ruoyi.common.core.text.Convert;

/**
 * 售后预约Service业务层处理
 * 
 * @author Alan Zhang
 * @date 2025-03-29
 */
@Service
public class JtCustomerServiceServiceImpl implements IJtCustomerServiceService 
{
    @Autowired
    private JtCustomerServiceMapper jtCustomerServiceMapper;

    /**
     * 查询售后预约
     * 
     * @param serviceId 售后预约主键
     * @return 售后预约
     */
    @Override
    public JtCustomerService selectJtCustomerServiceByServiceId(Long serviceId)
    {
        return jtCustomerServiceMapper.selectJtCustomerServiceByServiceId(serviceId);
    }

    /**
     * 查询售后预约列表
     * 
     * @param jtCustomerService 售后预约
     * @return 售后预约
     */
    @Override
    public List<JtCustomerService> selectJtCustomerServiceList(JtCustomerService jtCustomerService)
    {
        return jtCustomerServiceMapper.selectJtCustomerServiceList(jtCustomerService);
    }

    /**
     * 新增售后预约
     * 
     * @param jtCustomerService 售后预约
     * @return 结果
     */
    @Override
    public int insertJtCustomerService(JtCustomerService jtCustomerService)
    {
        jtCustomerService.setCreateBy(ShiroUtils.getSysUser().getUserName());
        jtCustomerService.setCreateTime(DateUtils.getNowDate());
        return jtCustomerServiceMapper.insertJtCustomerService(jtCustomerService);
    }

    /**
     * 修改售后预约
     * 
     * @param jtCustomerService 售后预约
     * @return 结果
     */
    @Override
    public int updateJtCustomerService(JtCustomerService jtCustomerService)
    {
        jtCustomerService.setUpdateBy(ShiroUtils.getSysUser().getUserName());
        jtCustomerService.setUpdateTime(DateUtils.getNowDate());
        return jtCustomerServiceMapper.updateJtCustomerService(jtCustomerService);
    }

    /**
     * 批量删除售后预约
     * 
     * @param serviceIds 需要删除的售后预约主键
     * @return 结果
     */
    @Override
    public int deleteJtCustomerServiceByServiceIds(String serviceIds)
    {
        return jtCustomerServiceMapper.deleteJtCustomerServiceByServiceIds(Convert.toStrArray(serviceIds));
    }

    /**
     * 删除售后预约信息
     * 
     * @param serviceId 售后预约主键
     * @return 结果
     */
    @Override
    public int deleteJtCustomerServiceByServiceId(Long serviceId)
    {
        return jtCustomerServiceMapper.deleteJtCustomerServiceByServiceId(serviceId);
    }
}
